/**
 * @author tongchen
 * @create 2023-01-06 22:11
 */
public class Schedule {
    public static void main(String[] args) {
        int[]begin={1,0,3,3,5,5,6,8,8,2,12};
        int[]end={4,6,5,8,7,9,10,11,12,13,14};
        bubble_sort(end,begin);
        int i=0;

        while(i<end.length){
            System.out.println(i);
            for(int j=i+1;j< end.length;++j){
                if(begin[j]>end[i]){
                    i=j;
                    break;
                }
            }
            System.out.println(i);
            if(i== end.length-1){
                break;
            }
        }
    }
    public static void bubble_sort(int[]arr,int[]brr){
        boolean flag=false;
        for(int i=0;i< arr.length-1;++i){
            for(int j=0;j< arr.length-1-i;++j){
                if(arr[j]>arr[j+1]){
                    int temp=arr[j];
                    int temp1=brr[j];
                    arr[j]=arr[j+1];
                    brr[j]=brr[j+1];
                    arr[j+1]=temp;
                    brr[j+1]=temp1;
                    flag=true;
                }

            }
            if(flag=false){
                return;
            }
        }
    }
}
